<?php

// +----------------------------------------------------------------------
// | ThinkAdmin
// +----------------------------------------------------------------------
// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://demo.thinkadmin.top
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | gitee 代码仓库：https://gitee.com/zoujingli/ThinkAdmin
// | github 代码仓库：https://github.com/zoujingli/ThinkAdmin
// +----------------------------------------------------------------------

use think\facade\Request;
use think\facade\Route;



Route::group('api', function () {


    Route::group('index', function (){

        //首页
        Route::get('index', 'index/api.HomePage/index');



    });


    /**
     * 用户中心接口列表
     */
    Route::group('user', function (){
        //用户信息
        Route::get('userInfo', 'index/api.UserCenter/userInfo');


        //我的兼职记录
        Route::get('myJoinJob', 'index/api.UserJobs/joinJobList');
        //我的发布兼职记录
        Route::get('myPublishJob', 'index/api.UserJobs/publishJobList');
        //删除兼职
        Route::post('delJob', 'index/api.UserJobs/delJob');
        //结束招聘,进入工作阶段
        Route::post('closeApply', 'index/api.UserJobs/closeApply');
        //审核报名人员
        Route::get('applyUserList', 'index/api.UserJobs/applyUserList');
        //完成工作，结算
        Route::post('doneJob', 'index/api.UserJobs/doneJob');
        //取消报名
        Route::post('cancelJob', 'index/api.UserJobs/cancelJob');
        //置顶兼职
        Route::post('topJob', 'index/api.UserJobs/topJob');


        //我的二手商品
        Route::get('myPublishMarket', 'index/api.UserMarket/myPublishGoods');
        //删除二手商品
        Route::post('delGoods', 'index/api.UserMarket/delGoods');


        //收藏
        Route::post('collect', 'index/api.UserCenter/collect');
        //取消收藏
        Route::post('delCollect', 'index/api.UserCenter/delCollect');
        //兼职收藏
        Route::get('jobCollect', 'index/api.UserJobs/jobCollectList');
        //二手商品收藏
        Route::get('usedGoodsCollect', 'index/api.UserMarket/collectGoodsList');


        //认证个人
        Route::get('approvePerson', 'index/api.UserCenter/approvePersonNeed');
        Route::post('approvePerson', 'index/api.UserCenter/submitApprovePerson');
        //认证企业
        Route::post('approveCompany', 'index/api.UserCenter/submitApproveCompany');


        //用户钱包中心
        Route::get('myWallet', 'index/api.UserWallet/index');
        //汇豆记录
        Route::get('beanList', 'index/api.UserWallet/beanList');
        //积分记录
        Route::get('creditsList', 'index/api.UserWallet/creditsList');
        
        //用户充值
        Route::post('rechargeBean', 'index/api.UserWallet/rechargeBean');
        Route::post('wechatPayInfo', 'index/api.UserWallet/wechatPayInfo');
        Route::post('cancelRechargeBean', 'index/api.UserWallet/cancelRechargeBean');
        //活动充值发布豆
        Route::post('activeRechargeBean', 'index/api.UserWallet/activeRechargeBean');


        //我的信用分记录
        Route::get('scoreList', 'index/api.UserWallet/scoreList');


        //微信支付购买豆回调
        Route::any('buyBeanNotify', 'index/api.WechatPayNotify/payBeanNotify');

    });


    /**
     * 兼职操作接口列表
     */
    Route::group('job', function (){
        //兼职首页
        Route::get('listJob', 'index/api.Jobs/index');
        //兼职详情
        Route::get('detail', 'index/api.Jobs/detail');

        //兼职分类
        Route::get('jobType', 'index/api.Jobs/jobTypeList');
        //兼职结算方式
        Route::get('indexCommon', 'index/api.Jobs/jobSelectCommon');

        //兼职报名人员详细列表
        Route::get('applyUserList', 'index/api.UserJobs/applyUserList');
        //审核报名人员
        Route::post('checkUser', 'index/api.UserJobs/checkUsers');


        //发布兼职需要的信息
        Route::get('publishNeedData', 'index/api.Jobs/publishNeedData');
        //保存兼职为草稿
        Route::post('saveDraft', 'index/api.Jobs/saveJobDraft');
        //保存兼职发布
        Route::post('publishJob', 'index/api.Jobs/publishJob');
        //审核兼职
        Route::post('auditJob', 'index/api.Jobs/auditJob');

        //报名兼职
        Route::post('applyJob', 'index/api.Jobs/applyJob');

        //获取置顶兼职需要的发布豆
        Route::get('getTopJobNeedBean', 'index/api.Jobs/getTopJobNeedBean');

    });


    /**
     * 二手商城接口集
     */
    Route::group('market', function () {
        //二手商品类型
        Route::get('marketType', 'index/api.Market/marketType');
        //二手商品列表
        Route::get('goodsList', 'index/api.Market/goodsList');
        //二手商品详细
        Route::get('goodsDetail', 'index/api.Market/goodsDetail');

        //保存二手商品为草稿
        Route::post('saveDraft', 'index/api.Market/saveGoodsDraft');
        //发布二手商品
        Route::post('publishGoods', 'index/api.Market/publishGoods');

        //审核二手商品
        Route::post('auditGoods', 'index/api.UserMarket/auditGoods');

    });



    /**
     * 商企接口
     */
    Route::group('bus', function () {
        //企业列表
        Route::get('businessList', 'index/api.Business/businessList');

        //获取商家信息
        Route::get('businessInfo', 'index/api.Business/businessInfo');

    });


    /**
     * 资讯接口
     */
    Route::group('news', function () {

        //帮助中心
        Route::get('helpList', 'index/api.NewsCenter/helpList');

        //资讯类别
        Route::get('newsList', 'index/api.NewsCenter/newsList');

        //资讯详情
        Route::get('detail', 'index/api.NewsCenter/newsDetail');

        //单页
        Route::get('singlePage', 'index/api.NewsCenter/singlePage');

    });


    /**
     * 公用数据接口
     */
    Route::group('common', function (){
        //工作区域可选列表
        Route::get('areaTree', 'index/api.OtherCommon/areaTree');
        //获取两个点之间点距离
        Route::get('distance', 'index/api.OtherCommon/getLocationDistance');
        //经纬度转化成系统中的城市
        Route::post('transLocation', 'index/api.OtherCommon/transLocation');


        //search school
        Route::post('searchSchool', 'index/api.OtherCommon/searchSchool');
        //search major
        Route::post('searchMajor', 'index/api.OtherCommon/searchMajor');
        //search job
        Route::post('searchJob', 'index/api.Jobs/searchJob');

        //upload img
        Route::post('uploadImg', 'index/api.OtherCommon/uploadImg');

        //系统中开通的地区
        Route::get('openArea', 'index/api.OtherCommon/systemOpenArea');

        //获取banner
        Route::get('bannerItems', 'index/api.OtherCommon/bannerItems');

        //发送验证码短信
        Route::post('smsCode', 'index/api.OtherCommon/sendSmsCode');

        //充值活动详情
        Route::get('chargeActiveInfo', 'index/api.OtherCommon/chargeActive');

    });



});
